/* 
  Google Hangouts-like bootstrap css originally from:  
  http://bootsnipp.com/snippets/featured/like-hangout-chat
  by SrPatinhas

  as well as some css from "Chat": http://bootsnipp.com/snippets/featured/chat
  by hardiksondagar
 */

.conversation-wrap {
  box-shadow: -2px 0 3px #ddd;
  padding:0;
  @extend .col-lg-3;

  .conversation {
    position: relative;
    display: block;
    padding:5px;
    border-bottom:1px solid #ddd;
    margin:0;

    .avatar {
      width: 50px;
      height: 50px;
    }


    &:hover {
      cursor: hand;
      cursor: pointer;
      opacity: .8;
    }

    // http://ctrlq.org/code/19639-turn-div-clickable-link
    .div-link {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      text-decoration: none;
      /* Makes sure the link doesn't get underlined */
      z-index: 10;
      /* raises anchor tag above everything else in div */
      background-color: white;
      /*workaround to make clickable in IE */
      opacity: 0;
      /*workaround to make clickable in IE */
      filter: alpha(opacity=0);
      /*workaround to make clickable in IE */
    }

  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
  }

  &::-webkit-scrollbar-thumb {
    background:#ddd; 
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
  }
  &::-webkit-scrollbar-thumb:window-inactive {
    background: #ddd; 
  }
}

.chat-window-container {
  @extend .row;
}

.chat-window {
  @extend .col-xs-5; 
  @extend .col-md-3;

  bottom: 0;
  right: 0;
  position: fixed;
  float: right;
  margin-left: 10px;

  .panel-container {
    @extend .col-xs-12; 
    @extend .col-md-12;
  }

  > div > .panel {
    border-radius: 5px 5px 0 0;
  }

  .panel-footer {
    .chat-input {
      @extend .input-sm;
      @extend .form-control;
    }

    .btn-chat {
      @extend .btn;
      @extend .btn-primary;
      @extend .btn-sm;
    }
  }

  .col-md-2, .col-md-10 {
    padding: 0;
  }

  .panel {
    margin-bottom: 0px;
  }

  .icon_minim {
    padding: 2px 10px;
  }

  .msg-container-base {
    background: #e5e5e5;
    margin: 0;
    padding: 0 10px 10px;
    max-height: 300px;
    overflow-x: hidden;
  }

  .top-bar {
    background: #666;
    color: white;
    padding: 10px;
    position: relative;
    overflow: hidden;

    .panel-title-container {
      @extend .col-md-10; 
      @extend .col-xs-10;
    }
    .panel-buttons-container {
      @extend .col-md-2; 
      @extend .col-xs-2;
    }
  }

  .msg-receive {
    padding-left: 0;
    margin-left: 0;
  }

  .msg-sent {
    padding-bottom: 20px !important;
    margin-right: 0;
  }

  .messages {
    @extend .col-md-10;
    @extend .col-xs-10;

    background: white;
    padding: 10px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    > {
      p {
        font-size: 13px;
        margin: 0 0 0.2rem 0;
      }
      time {
        font-size: 11px;
        color: #ccc;
      }
    }
  }

  .msg-container {
    @extend .row;
    padding: 10px;
    overflow: hidden;
    display: flex;

    .avatar {
      @extend .col-md-2;
      @extend .col-xs-2;

      img {
        @extend .img-responsive;
      }
    }
  }

  img {
    display: block;
    width: 100%;
  }

  .avatar {
    position: relative;
  }

  .base-receive > .avatar:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border: 5px solid #FFF;
    border-left-color: rgba(0, 0, 0, 0);
    border-bottom-color: rgba(0, 0, 0, 0);
  }

  .base-sent {
    justify-content: flex-end;
    align-items: flex-end;
    > .avatar:after {
      content: "";
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0;
      height: 0;
      border: 5px solid white;
      border-right-color: transparent;
      border-top-color: transparent;
      box-shadow: 1px 1px 2px rgba(black, 0.2);
    }
  }

  .msg-sent > time {
    float: right;
  }

  .msg-container-base {
    &::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      background-color: #F5F5F5;
    }
    &::-webkit-scrollbar {
      width: 12px;
      background-color: #F5F5F5;
    }
    &::-webkit-scrollbar-thumb {
      -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
      background-color: #555;
    }
  }

  .btn-group.dropup {
    position: fixed;
    left: 0px;
    bottom: 0;
  }

}

